# # # 字符串str
# # 1，使用引号
# s1 = "hello world"
# print(s1)
# print(type(s1))
# #
# s2 = "你好，张涛"
# print(s2)
# print(type(s2))
#
#
# # 2,使用str（）函数进行创建
# num1 = 10
# print(type(num1))
# s3 = str(num1)
# print(s3)
# print(type(s3))
# num2 = 3.1415926
# print(type(num2))
# s4 = str(num2)
# print(s4)
# print(type(s4))
#
#
# # 字符串的格式化
# # 1，使用替换符%
# # 浮点型转化
# s5 = "浮点数精确为：%f" % 1.2345
# print(s5)
# s6 = "浮点数精确为：%.3f" % 1.2345
# print(s6)
# # 整数转化
# s7 = "整数精确为：%d"% 1.2345
# print(s7)
# # 字符串转化
# s8 = "字符串为：%s"% 1.23456
# print(s8)
#
# # 字符串的合并
# # 1，使用“+”对多个字符串进行连接
# s9 = "holle"
# s10 = "world"
# print(s9 + s10)
# # 使用星号（*）进行重复
# print(s9*10)
# # 用join函数对多个字符串连接
# s11 = ["holle","python","holle"]
# s12 = "123"
# print("".join(s11))
# print(s12.join(s11))
# # 字符串的截取
# 1，使用索引截取单个字符
# s13 = "python"
# print(s13[3])
# print(s13[-3])
#
# # 2,使用切片
# s14 = "python"
# print(s14[0:5])
# print(s14[2:5])   # 取下2-4的字符
# print(s14[3:1])   # 输出为空
#
# # 3,使用split()函数截取字符串 字符串名.split(分隔符）
# s15 = "开始，    ，1，   2，    3333，   4，  5,6"
# print(s15.split())
# print(s15.split("3333"))      #以“ ，”分割

# #  # 字符串的比较
# # Python使用“==”“！=”运算符比较字符串的内容
# str1 = 123
# str2 = "123"

# #  未转化数据类型
# if str1 == str2:
#     print("相同")
# else:
#     print("不同")

# # 转化数据类型
# if str(str1) == str2:
#     print("相同")
# else:
#     print("不同")
#

# # 字符串的长度len（）
# # 字符串
# str3 = "hello,world!"
# print(len(str3))
# # 2,列表
# l1 = [1, 2, 3, 4, "hello", "world", "!"]
# print(len(l1))


# # 查找字符串find（）
# s4 = "12345600"
# print(s4.find("3"))
# print(s4.find("123"))
# print(s4.find("b"))


# 替换replace(old,new)
# s5 = "hello world! hello python! hello shijiazhuang!"
# s6 = s5.replace("hello", "hi")
# print(s6)
# s7 = s5.replace("hello", "hi", 2)
# print(s7)
# s8 = s5.replace(" ", "")
# print(s8)

# # 字符串的遍历
# # for
# s9 = "hello,world!"
# for i in s9:
#     print(i, end="  ")
#

# # 使用索引打印每个字符
# s10 = "hello,world!"
# print(len(s10))
# for i in range(len(s10)):
#     print(s10[i], end="   ")
#
#
# # 遍历部分
# s11 = "hello,world!"
# for i in s11[7:12]:
#     print(i, end="  ")
#